﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using WindowsInput;

public class Keyboard : MonoBehaviour {

    public InputField inputArea;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

    public void Q()
    {
        inputArea.ActivateInputField();
        StartCoroutine(Key_Q());
    }
    public void W()
    {
        inputArea.ActivateInputField();
        StartCoroutine(Key_W());
    }

    IEnumerator Key_Q()
    {
        yield return null;
        inputArea.GetComponent<InputField>().MoveTextEnd(false);
        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_Q);
    }

    IEnumerator Key_W()
    {
        yield return null;
        inputArea.GetComponent<InputField>().MoveTextEnd(false);
        InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_W);
    }
}
